import { Dimensions, PixelRatio, AsyncStorage } from 'react-native';
import Storage from 'react-native-storage';

const storage = new Storage({
  // maximum capacity, default 1000
  size: 1000,

  // Use AsyncStorage for RN, or window.localStorage for web.
  // If not set, data would be lost after reload.
  storageBackend: AsyncStorage,

  // expire time, default 1 day(1000 * 3600 * 24 milliseconds).
  // can be null, which means never expire.
  defaultExpires: 1000 * 3600 * 24,

  // cache data in the memory. default is true.
  enableCache: true,

  // if data was not found in storage or expired,
  // the corresponding sync method will be invoked and return
  // the latest data.
  sync: {
    // we'll talk about the details later.
  },
});
const version = 'V2.0.0';
const tpl = '';
const dealerId = '';
const factoryId = '';
const window = {
  width: Dimensions.get('window').width,
  height: Dimensions.get('window').height,
  onePR: 1 / PixelRatio.get(),
};
const doCallback = (cb) => {
  if (cb) {
    cb();
  }
};
const carcolor = {
  orange: '#9c2f10',
  red: '#710a0d',
  blue: '#0a3f86',
  white: '#b9bdc6',
  black: '#121214',
  grey: '#6f737c',
  golden: '#696644',
};
const focusItems = {
  airConditioner: '空调区',
  airconditioner: '空调区',
  backChair: '后座',
  backchair: '后座',
  backexhaust: '后排气',
  dashboard: '仪表盘',
  door: '车门',
  doorBL: '左后门',
  doorBR: '右后门',
  doorFL: '左前门',
  doorFR: '右前门',
  doorbl: '左后门',
  doorbr: '右后门',
  doorfl: '左前门',
  doorfr: '右前门',
  engine: '发动机盖',
  fangXiangPan: '方向盘',
  fangxiangpan: '方向盘',
  frontLight: '前大灯',
  frontlight: '前大灯',
  fuJia: '副驾驶位',
  fujia: '副驾驶位',
  houBaoXianGang: '后保险杠',
  houbaoxiangang: '后保险杠',
  innerTop: '车内顶部',
  innertop: '车内顶部',
  lightShaChe: '刹车灯',
  lightshache: '刹车灯',
  lunGu: '轮毂',
  lungu: '轮毂',
  qianGeZha: '前格栅',
  qiangezha: '前格栅',
  shiftGear: '变速档位',
  shiftgear: '变速档位',
  skylight: '天窗',
  trunk: '后备箱',
  video: '多媒体区',
  walkingBox: '手扶箱',
  walkingbox: '手扶箱',
  window: '车窗',
};

export default {
  window,
  version,
  tpl,
  carcolor,
  dealerId,
  factoryId,
  focusItems,
  doCallback,
  storage,
};
